package main.java.com.action;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/Myservlet")
public class Myservlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
        //获取请求参数
        String content=request.getParameter("content");
        System.out.println(content);
        //获取域数据的方法
        request.getSession().setAttribute("content",content);
        //getRequestDispatchar获取转发对象
        request.getRequestDispatcher("/WEB-INF/jsp/b.jsp").forward(request,response);
    }
}
